<!--
 * @Description: 单点登录跳转
 * @Author: zhailei
 * @Date: 2021-06-02 13:38:08
 * @LastEditTime: 2023-02-15 14:34:29
 * @LastEditors: your name
 * @FilePath: \vite-demoe:\wwwroot\Vue\\-cloud-vue\src\pages\login\oauth2.vue
-->
<template>
  <div>
    <!-- {{accessToken}} -->
  </div>
</template>

<script>
import { axios } from "@/utils/request";
import Vue from "vue";
import store from "@/store";
import { ACCESS_TOKEN } from "@/store/mutation-types";
import { delCookie, setCookie, getCookie } from "@/utils/TopVUI.js";
import { GetUrlParam } from "@/utils/util.js";

export default {
  name: "SsoLogin",
  mounted() {
    let oauthUrl = window.location.href;
    let paramMap = GetUrlParam(oauthUrl);
    this.accessToken = paramMap.token;
    let portalAddress = decodeURIComponent(paramMap.portalAddress);
    let detailsUuid = paramMap.detailsUuid; //详情使用
    setCookie("detailsUuid", detailsUuid); //详情使用
    Vue.ls.set(ACCESS_TOKEN, this.accessToken);
    store.commit("SET_TOKEN", this.accessToken);
    this.$router.push({
      path: portalAddress,
    });
  },
  methods: {},
};
</script>
